Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/evsemanager persistent transactions #789

Merged
merged 14 commits into from
Jul 31, 2024

Conversation

corneliusclaussen
Copy link
Contributor

@corneliusclaussen corneliusclaussen commented Jul 17, 2024

Describe your changes

  • EvseManager can now use a PersistentStore module to store the transaction UUID. This is used to cleanup dangling sessions on Eichrecht power meters and issue a correct TransactionFinished event including OCMF on the next boot.
  • Added SessionEventEnum SessionResumed to allow the evse_manager to indicate that a previous session has been resumed at startup
  • Added subscription to this event to OCPP module so that OCPP is aware that the EvseManager is aware of previous transactions. This allows OCPP to not terminate such transactions individually every time

Issue ticket number and link

Companion PR in libocpp: EVerest/libocpp#704

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@Pietfried Pietfried force-pushed the feature/evsemanager_persistent_transactions branch from 74a86fa to 74a7277 Compare July 22, 2024 16:38
@Pietfried Pietfried force-pushed the feature/evsemanager_persistent_transactions branch 2 times, most recently from 19d5641 to acc7a34 Compare July 25, 2024 11:03
@Pietfried Pietfried force-pushed the feature/evsemanager_persistent_transactions branch from 1f171d7 to 4079b07 Compare July 26, 2024 10:45
@Pietfried Pietfried marked this pull request as ready for review July 26, 2024 11:55
@corneliusclaussen corneliusclaussen force-pushed the feature/evsemanager_persistent_transactions branch from f4e0b3f to ff2d0fe Compare July 29, 2024 06:45
@Pietfried Pietfried force-pushed the feature/evsemanager_persistent_transactions branch from ff2d0fe to f6a337f Compare July 29, 2024 11:59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: update dependencies

@@ -0,0 +1,44 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Pionix GmbH and Contributors to EVerest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024 or leave the date out entirely

@@ -0,0 +1,33 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 - 2021 Pionix GmbH and Contributors to EVerest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024 or leave out entirely

corneliusclaussen and others added 11 commits July 31, 2024 10:05
Implementation of evse_board_support was simplified a bit. The sync
command to get hw capablities on startup is no longer needed as the
async publish of capablities is enough. Each BSP implementation module
is required to publish its capablities at least once in the ready
function. It may publish it later on to update the values e.g. for
thermal derating.

1ph/3ph switching support during charging with a hyteresis if the
1ph/3ph power ranges overlap (e.g. on 22kW).
Hysteresis only really works if EV and EVSE have the same max current rating, e.g. both 16A
See doc.rst for details.

Signed-off-by: Cornelius Claussen <[email protected]>
Signed-off-by: pietfried <[email protected]>
If EvseManager has a connection to a PersistentStore/kvs module, it now
stores the transaction UUID persistently.

It checks on startup if a transaction is still ongoing and tries to
close it in the power meter to fetch the OCMF data.
Then it emits a TransactionFinished event (with OCMF included if the
powermeter transaction stop was successful, otherwise the event is sent
without OCMF).

After that it clears any other transaction that still may be ongoing in
the powermeter by calling stop_transaction with an empty string as
session id.

LEM driver was adapted to support the cleanup with empty UUIDs on start
up.

Signed-off-by: Cornelius Claussen <[email protected]>
Signed-off-by: florinmihut <[email protected]>
Signed-off-by: pietfried <[email protected]>
…indicate that a previous session has been resumed at startup

* Added subscription to this event to OCPP module so that OCPP is aware that the EvseManager is aware of previous transactions. This allows OCPP to not terminate such transactions individually every time

Signed-off-by: pietfried <[email protected]>
Signed-off-by: florinmihut <[email protected]>
Signed-off-by: Piet Gömpel <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: florinmihut <[email protected]>
Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried force-pushed the feature/evsemanager_persistent_transactions branch from f6a337f to 3d1328e Compare July 31, 2024 08:20
Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried merged commit f720edb into main Jul 31, 2024
7 of 8 checks passed
@Pietfried Pietfried deleted the feature/evsemanager_persistent_transactions branch July 31, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants